home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / blitz-list200994.lha / blitz-list / NeilsLibs.lha / AmigaSupportLib.doc < prev    next >
Encoding:
Text File  |  1994-04-28  |  2.3 KB  |  80 lines

  1. Amiga Support Library documentation
  2.  
  3.  
  4. 680x0 coding: Neil O'Rourke
  5. Ideas and nagging: Roy "The Rat" Hurley
  6.  
  7.  
  8. Version 1.1 (28/4/94)
  9.  
  10.  
  11. This library is simply to give the average user some commands to make life
  12. that little bit easier.  Have you ever asked Exec to
  13. AllocMem_($c8000,#MEMF_FAST) - thats 800k of memory!  I have, and when the
  14. program exited on me by accident, that memory couldn't be reclaimed!  Enter
  15. AllocMem and FreeMem.  They do exactly the same job, but if you forget to
  16. free up the memory, Blitz will do it for you at the end.
  17.  
  18. Other commands in the library have their origins with Roy Hurley.  He
  19. generally nagged me into adding BLoad and BSave.  The SearchString routine
  20. came from one of Roy's articles in ACAR, I just squeezed it into my
  21. library.
  22.  
  23.  
  24. Basic Commands
  25. ~~~~~~~~~~~~~~
  26.  
  27. This library contains the following commands:
  28.  
  29.  
  30. MemoryBlock=AllocMem(ByteSize,Requirements)
  31.   (long)               (long)    (long)
  32.  
  33. This routine simply calles the Blitz AllocMem() routine so that any memory
  34. blocks allocated with it are freed when the program ends (if not already
  35. freed) or if the program aborts (during development of course :)
  36.  
  37.  
  38. FreeMem MemoryBlock,ByteSize
  39.            (long)    (long)
  40.  
  41. Deallocates memory obtained with AllocMem
  42.  
  43.  
  44. result=IsEven(Expression)
  45. (bool)        (byte,word,long)
  46.  
  47. Returns true if Expression is even.  Of use when requesting a value from a
  48. user that MUST be even.
  49.  
  50.  
  51. result=SearchString(StringPointer,StartAddress,BlockLength)
  52. (long)                (&string)    (long)        (long)
  53.  
  54. Finds a string in the given memory block and returns its address.  Returns
  55. False otherwise.
  56.  
  57.  
  58. BLoad(FileName$,MemoryType)
  59.  
  60. Loads the named file into memory, which can be selected, eg #MEMF_CHIP,
  61. #MEMF_FAST.  Set this flag to 0 if you don't care.  This function returns
  62. either 0 or an address of a newtype, pointing to two longwords.  The first
  63. word is the file's location in memory, the second it the file's size.
  64. Don't loose this address!
  65.  
  66. In the event of an error, just call IoErr_() to find out what happened.
  67.  
  68. bugs:  Don't ask for #MEMF_CLEAR.  The Blitz AllocMem doesn't like it.
  69. This is not my problem!  Get onto Simon to have this extended.
  70.  
  71.  
  72. BSave FileName$,Address,Size
  73.  
  74. Save the named file out.
  75.  
  76.  
  77. BFree AddressReturnedFromBLoad
  78.  
  79. Frees both the file that has been loaded and the newtype created.
  80.